﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core;
using COFE.Core.Lister;
using System.IO;

namespace COFE.Web
{
    /// <summary>
    /// Interface for a user on the Web services level.   
    /// </summary>
    public interface IUserServiceProfile
    {
        /// <summary>
        /// Find an entry using path.
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        Entry LookupEntry(string path);

        /// <summary>
        /// Find an entry using it's unique id, it works only if it's cached (either temp storage or database).
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Entry LookupEntry(Guid id);

        /// <summary>
        /// List child entries of a directory entry.
        /// </summary>
        /// <param name="parentEntry"></param>
        /// <param name="filter">Additional filter, current use for pageination.</param>        
        /// <returns></returns>
        EntryList ListEntry(Entry parentEntry, string filterStr);

        /// <summary>
        /// Get a propertyName of an entry.  
        /// Resource is a kind of property thats marked as Resource in COFE, see COFE.Core.ResourceAttribute for more details.
        /// </summary>
        /// <param name="entry"></param>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        PropertyPair GetResource(Entry entry, string resourceName);

        /// <summary>
        /// Get the file stream of a file entry.
        /// </summary>
        /// <param name="entry"></param>
        /// <returns></returns>
        Stream GetFileStream(Entry entry);

        /// <summary>
        /// Update (overwrite) the file stream of a file entry.
        /// </summary>
        /// <param name="entry"></param>
        /// <param name="stream"></param>
        void SetFileStream(Entry entry, Stream stream);       

        /// <summary>
        /// UserName of the UserProfile.
        /// </summary>
        string UserName { get; }

        /// <summary>
        /// Gets the user manager in COFE level.
        /// </summary>
        IUserProfile2 UserProfile { get; }

       

        
    }
}
